import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 查询商品列表
export function listCommodity(query) {
  return request({
    url: '/commodity/commodity/list',
    method: 'get',
    params: query
  })
}

// 查询用户详细
export function getCommodity(commodityId) {
  return request({
    url: '/commodity/commodity/' + parseStrEmpty(commodityId),
    method: 'get'
  })
}
//修改商品
export function updateCommodity(data) {
  return request({
    url: '/commodity/commodity',
    method: 'put',
    data: data
  })
}
// 新增商品
export function addCommodity(data) {
  return request({
    url: '/commodity/commodity',
    method: 'post',
    data: data
  })
}

//删除商品
export function delCommodity(commodityIds){
  return request({
    url: '/commodity/commodity/' + commodityIds,
    method: 'delete'
  })
}

export function CategoryTreeSelect(){
  return request({
    url:'/commodity/commodity/categoryTree',
    method: 'get'
  })
}


